driftdetect-core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analyzers/ast-analyzer.d.ts +251 -0
- package/dist/analyzers/ast-analyzer.d.ts.map +1 -0
- package/dist/analyzers/ast-analyzer.js +548 -0
- package/dist/analyzers/ast-analyzer.js.map +1 -0
- package/dist/analyzers/flow-analyzer.d.ts +241 -0
- package/dist/analyzers/flow-analyzer.d.ts.map +1 -0
- package/dist/analyzers/flow-analyzer.js +1219 -0
- package/dist/analyzers/flow-analyzer.js.map +1 -0
- package/dist/analyzers/index.d.ts +18 -0
- package/dist/analyzers/index.d.ts.map +1 -0
- package/dist/analyzers/index.js +19 -0
- package/dist/analyzers/index.js.map +1 -0
- package/dist/analyzers/semantic-analyzer.d.ts +252 -0
- package/dist/analyzers/semantic-analyzer.d.ts.map +1 -0
- package/dist/analyzers/semantic-analyzer.js +1182 -0
- package/dist/analyzers/semantic-analyzer.js.map +1 -0
- package/dist/analyzers/type-analyzer.d.ts +289 -0
- package/dist/analyzers/type-analyzer.d.ts.map +1 -0
- package/dist/analyzers/type-analyzer.js +1269 -0
- package/dist/analyzers/type-analyzer.js.map +1 -0
- package/dist/analyzers/types.d.ts +537 -0
- package/dist/analyzers/types.d.ts.map +1 -0
- package/dist/analyzers/types.js +11 -0
- package/dist/analyzers/types.js.map +1 -0
- package/dist/config/config-loader.d.ts +166 -0
- package/dist/config/config-loader.d.ts.map +1 -0
- package/dist/config/config-loader.js +429 -0
- package/dist/config/config-loader.js.map +1 -0
- package/dist/config/config-validator.d.ts +204 -0
- package/dist/config/config-validator.d.ts.map +1 -0
- package/dist/config/config-validator.js +632 -0
- package/dist/config/config-validator.js.map +1 -0
- package/dist/config/defaults.d.ts +8 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +26 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/index.d.ts +10 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +10 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/types.d.ts +47 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +7 -0
- package/dist/config/types.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest/exporter.d.ts +21 -0
- package/dist/manifest/exporter.d.ts.map +1 -0
- package/dist/manifest/exporter.js +339 -0
- package/dist/manifest/exporter.js.map +1 -0
- package/dist/manifest/index.d.ts +14 -0
- package/dist/manifest/index.d.ts.map +1 -0
- package/dist/manifest/index.js +15 -0
- package/dist/manifest/index.js.map +1 -0
- package/dist/manifest/manifest-store.d.ts +111 -0
- package/dist/manifest/manifest-store.d.ts.map +1 -0
- package/dist/manifest/manifest-store.js +418 -0
- package/dist/manifest/manifest-store.js.map +1 -0
- package/dist/manifest/types.d.ts +238 -0
- package/dist/manifest/types.d.ts.map +1 -0
- package/dist/manifest/types.js +11 -0
- package/dist/manifest/types.js.map +1 -0
- package/dist/matcher/confidence-scorer.d.ts +188 -0
- package/dist/matcher/confidence-scorer.d.ts.map +1 -0
- package/dist/matcher/confidence-scorer.js +302 -0
- package/dist/matcher/confidence-scorer.js.map +1 -0
- package/dist/matcher/index.d.ts +24 -0
- package/dist/matcher/index.d.ts.map +1 -0
- package/dist/matcher/index.js +26 -0
- package/dist/matcher/index.js.map +1 -0
- package/dist/matcher/outlier-detector.d.ts +252 -0
- package/dist/matcher/outlier-detector.d.ts.map +1 -0
- package/dist/matcher/outlier-detector.js +544 -0
- package/dist/matcher/outlier-detector.js.map +1 -0
- package/dist/matcher/pattern-matcher.d.ts +169 -0
- package/dist/matcher/pattern-matcher.d.ts.map +1 -0
- package/dist/matcher/pattern-matcher.js +692 -0
- package/dist/matcher/pattern-matcher.js.map +1 -0
- package/dist/matcher/types.d.ts +476 -0
- package/dist/matcher/types.d.ts.map +1 -0
- package/dist/matcher/types.js +36 -0
- package/dist/matcher/types.js.map +1 -0
- package/dist/parsers/base-parser.d.ts +282 -0
- package/dist/parsers/base-parser.d.ts.map +1 -0
- package/dist/parsers/base-parser.js +421 -0
- package/dist/parsers/base-parser.js.map +1 -0
- package/dist/parsers/css-parser.d.ts +225 -0
- package/dist/parsers/css-parser.d.ts.map +1 -0
- package/dist/parsers/css-parser.js +477 -0
- package/dist/parsers/css-parser.js.map +1 -0
- package/dist/parsers/index.d.ts +15 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +15 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/parsers/json-parser.d.ts +219 -0
- package/dist/parsers/json-parser.d.ts.map +1 -0
- package/dist/parsers/json-parser.js +602 -0
- package/dist/parsers/json-parser.js.map +1 -0
- package/dist/parsers/markdown-parser.d.ts +276 -0
- package/dist/parsers/markdown-parser.d.ts.map +1 -0
- package/dist/parsers/markdown-parser.js +731 -0
- package/dist/parsers/markdown-parser.js.map +1 -0
- package/dist/parsers/parser-manager.d.ts +294 -0
- package/dist/parsers/parser-manager.d.ts.map +1 -0
- package/dist/parsers/parser-manager.js +738 -0
- package/dist/parsers/parser-manager.js.map +1 -0
- package/dist/parsers/python-parser.d.ts +204 -0
- package/dist/parsers/python-parser.d.ts.map +1 -0
- package/dist/parsers/python-parser.js +517 -0
- package/dist/parsers/python-parser.js.map +1 -0
- package/dist/parsers/types.d.ts +43 -0
- package/dist/parsers/types.d.ts.map +1 -0
- package/dist/parsers/types.js +7 -0
- package/dist/parsers/types.js.map +1 -0
- package/dist/parsers/typescript-parser.d.ts +264 -0
- package/dist/parsers/typescript-parser.d.ts.map +1 -0
- package/dist/parsers/typescript-parser.js +658 -0
- package/dist/parsers/typescript-parser.js.map +1 -0
- package/dist/rules/evaluator.d.ts +305 -0
- package/dist/rules/evaluator.d.ts.map +1 -0
- package/dist/rules/evaluator.js +579 -0
- package/dist/rules/evaluator.js.map +1 -0
- package/dist/rules/index.d.ts +13 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +13 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/quick-fix-generator.d.ts +334 -0
- package/dist/rules/quick-fix-generator.d.ts.map +1 -0
- package/dist/rules/quick-fix-generator.js +1075 -0
- package/dist/rules/quick-fix-generator.js.map +1 -0
- package/dist/rules/rule-engine.d.ts +241 -0
- package/dist/rules/rule-engine.d.ts.map +1 -0
- package/dist/rules/rule-engine.js +585 -0
- package/dist/rules/rule-engine.js.map +1 -0
- package/dist/rules/severity-manager.d.ts +394 -0
- package/dist/rules/severity-manager.d.ts.map +1 -0
- package/dist/rules/severity-manager.js +619 -0
- package/dist/rules/severity-manager.js.map +1 -0
- package/dist/rules/types.d.ts +370 -0
- package/dist/rules/types.d.ts.map +1 -0
- package/dist/rules/types.js +133 -0
- package/dist/rules/types.js.map +1 -0
- package/dist/rules/variant-manager.d.ts +388 -0
- package/dist/rules/variant-manager.d.ts.map +1 -0
- package/dist/rules/variant-manager.js +777 -0
- package/dist/rules/variant-manager.js.map +1 -0
- package/dist/scanner/change-detector.d.ts +164 -0
- package/dist/scanner/change-detector.d.ts.map +1 -0
- package/dist/scanner/change-detector.js +263 -0
- package/dist/scanner/change-detector.js.map +1 -0
- package/dist/scanner/dependency-graph.d.ts +270 -0
- package/dist/scanner/dependency-graph.d.ts.map +1 -0
- package/dist/scanner/dependency-graph.js +436 -0
- package/dist/scanner/dependency-graph.js.map +1 -0
- package/dist/scanner/file-walker.d.ts +127 -0
- package/dist/scanner/file-walker.d.ts.map +1 -0
- package/dist/scanner/file-walker.js +526 -0
- package/dist/scanner/file-walker.js.map +1 -0
- package/dist/scanner/index.d.ts +12 -0
- package/dist/scanner/index.d.ts.map +1 -0
- package/dist/scanner/index.js +12 -0
- package/dist/scanner/index.js.map +1 -0
- package/dist/scanner/types.d.ts +218 -0
- package/dist/scanner/types.d.ts.map +1 -0
- package/dist/scanner/types.js +10 -0
- package/dist/scanner/types.js.map +1 -0
- package/dist/scanner/worker-pool.d.ts +317 -0
- package/dist/scanner/worker-pool.d.ts.map +1 -0
- package/dist/scanner/worker-pool.js +571 -0
- package/dist/scanner/worker-pool.js.map +1 -0
- package/dist/store/cache-manager.d.ts +179 -0
- package/dist/store/cache-manager.d.ts.map +1 -0
- package/dist/store/cache-manager.js +391 -0
- package/dist/store/cache-manager.js.map +1 -0
- package/dist/store/history-store.d.ts +314 -0
- package/dist/store/history-store.d.ts.map +1 -0
- package/dist/store/history-store.js +707 -0
- package/dist/store/history-store.js.map +1 -0
- package/dist/store/index.d.ts +20 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +26 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/lock-file-manager.d.ts +202 -0
- package/dist/store/lock-file-manager.d.ts.map +1 -0
- package/dist/store/lock-file-manager.js +475 -0
- package/dist/store/lock-file-manager.js.map +1 -0
- package/dist/store/pattern-store.d.ts +289 -0
- package/dist/store/pattern-store.d.ts.map +1 -0
- package/dist/store/pattern-store.js +936 -0
- package/dist/store/pattern-store.js.map +1 -0
- package/dist/store/schema-validator.d.ts +159 -0
- package/dist/store/schema-validator.d.ts.map +1 -0
- package/dist/store/schema-validator.js +1096 -0
- package/dist/store/schema-validator.js.map +1 -0
- package/dist/store/types.d.ts +585 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +82 -0
- package/dist/store/types.js.map +1 -0
- package/dist/types/analysis.d.ts +19 -0
- package/dist/types/analysis.d.ts.map +1 -0
- package/dist/types/analysis.js +5 -0
- package/dist/types/analysis.js.map +1 -0
- package/dist/types/common.d.ts +7 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +5 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +10 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/patterns.d.ts +40 -0
- package/dist/types/patterns.d.ts.map +1 -0
- package/dist/types/patterns.js +7 -0
- package/dist/types/patterns.js.map +1 -0
- package/dist/types/violations.d.ts +7 -0
- package/dist/types/violations.d.ts.map +1 -0
- package/dist/types/violations.js +7 -0
- package/dist/types/violations.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AST Analyzer - AST pattern analysis
|
|
3
|
+
*
|
|
4
|
+
* Performs AST pattern matching, subtree comparison, and provides
|
|
5
|
+
* traversal utilities for analyzing code structure.
|
|
6
|
+
*
|
|
7
|
+
* @requirements 3.5 - Parser SHALL provide a unified AST query interface across all languages
|
|
8
|
+
*/
|
|
9
|
+
import type { AST, ASTNode, Position } from '../parsers/types.js';
|
|
10
|
+
import type { ASTAnalysisResult, ASTStats, SourceLocation } from './types.js';
|
|
11
|
+
/**
|
|
12
|
+
* Pattern definition for AST matching
|
|
13
|
+
*/
|
|
14
|
+
export interface ASTPattern {
|
|
15
|
+
/** Node type to match (e.g., 'FunctionDeclaration', 'ClassDeclaration') */
|
|
16
|
+
type?: string;
|
|
17
|
+
/** Text content to match (exact or regex) */
|
|
18
|
+
text?: string | RegExp;
|
|
19
|
+
/** Whether text matching should be exact */
|
|
20
|
+
exactText?: boolean;
|
|
21
|
+
/** Child patterns to match */
|
|
22
|
+
children?: ASTPattern[];
|
|
23
|
+
/** Minimum number of children required */
|
|
24
|
+
minChildren?: number;
|
|
25
|
+
/** Maximum number of children allowed */
|
|
26
|
+
maxChildren?: number;
|
|
27
|
+
/** Custom predicate for additional matching logic */
|
|
28
|
+
predicate?: (node: ASTNode) => boolean;
|
|
29
|
+
/** Whether to match any descendant (not just direct children) */
|
|
30
|
+
matchDescendants?: boolean;
|
|
31
|
+
/** Capture name for extracting matched nodes */
|
|
32
|
+
capture?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Options for pattern matching
|
|
36
|
+
*/
|
|
37
|
+
export interface PatternMatchOptions {
|
|
38
|
+
/** Maximum number of matches to return */
|
|
39
|
+
limit?: number;
|
|
40
|
+
/** Whether to include nested matches */
|
|
41
|
+
includeNested?: boolean;
|
|
42
|
+
/** Starting position for the search */
|
|
43
|
+
startPosition?: Position;
|
|
44
|
+
/** Ending position for the search */
|
|
45
|
+
endPosition?: Position;
|
|
46
|
+
/** Minimum confidence threshold for matches */
|
|
47
|
+
minConfidence?: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Result of a pattern match with captured nodes
|
|
51
|
+
*/
|
|
52
|
+
export interface PatternMatchResult {
|
|
53
|
+
/** The matched node */
|
|
54
|
+
node: ASTNode;
|
|
55
|
+
/** Confidence score (0-1) */
|
|
56
|
+
confidence: number;
|
|
57
|
+
/** Captured nodes by name */
|
|
58
|
+
captures: Map<string, ASTNode>;
|
|
59
|
+
/** Location in source */
|
|
60
|
+
location: SourceLocation;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Options for subtree comparison
|
|
64
|
+
*/
|
|
65
|
+
export interface SubtreeCompareOptions {
|
|
66
|
+
/** Whether to ignore node text differences */
|
|
67
|
+
ignoreText?: boolean;
|
|
68
|
+
/** Whether to ignore position differences */
|
|
69
|
+
ignorePosition?: boolean;
|
|
70
|
+
/** Node types to ignore during comparison */
|
|
71
|
+
ignoreTypes?: string[];
|
|
72
|
+
/** Maximum depth to compare */
|
|
73
|
+
maxDepth?: number;
|
|
74
|
+
/** Similarity threshold (0-1) for considering subtrees similar */
|
|
75
|
+
similarityThreshold?: number;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Result of subtree comparison
|
|
79
|
+
*/
|
|
80
|
+
export interface SubtreeCompareResult {
|
|
81
|
+
/** Whether the subtrees are structurally identical */
|
|
82
|
+
isIdentical: boolean;
|
|
83
|
+
/** Similarity score (0-1) */
|
|
84
|
+
similarity: number;
|
|
85
|
+
/** Differences found between subtrees */
|
|
86
|
+
differences: SubtreeDifference[];
|
|
87
|
+
/** Statistics about the comparison */
|
|
88
|
+
stats: {
|
|
89
|
+
nodesCompared: number;
|
|
90
|
+
matchingNodes: number;
|
|
91
|
+
differentNodes: number;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A difference found between two subtrees
|
|
96
|
+
*/
|
|
97
|
+
export interface SubtreeDifference {
|
|
98
|
+
/** Type of difference */
|
|
99
|
+
type: 'type_mismatch' | 'text_mismatch' | 'children_count' | 'missing_child' | 'extra_child';
|
|
100
|
+
/** Path to the difference in the first subtree */
|
|
101
|
+
path1: number[];
|
|
102
|
+
/** Path to the difference in the second subtree */
|
|
103
|
+
path2: number[];
|
|
104
|
+
/** Description of the difference */
|
|
105
|
+
description: string;
|
|
106
|
+
/** Node from first subtree (if applicable) */
|
|
107
|
+
node1?: ASTNode;
|
|
108
|
+
/** Node from second subtree (if applicable) */
|
|
109
|
+
node2?: ASTNode;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Visitor function for AST traversal
|
|
113
|
+
*/
|
|
114
|
+
export type ASTVisitorFn = (node: ASTNode, parent: ASTNode | null, depth: number, path: number[]) => boolean | void;
|
|
115
|
+
/**
|
|
116
|
+
* AST Analyzer class for pattern matching and subtree comparison.
|
|
117
|
+
*
|
|
118
|
+
* Provides a unified interface for analyzing AST structures across
|
|
119
|
+
* all supported languages.
|
|
120
|
+
*
|
|
121
|
+
* @requirements 3.5 - Unified AST query interface across all languages
|
|
122
|
+
*/
|
|
123
|
+
export declare class ASTAnalyzer {
|
|
124
|
+
/**
|
|
125
|
+
* Find all nodes matching a pattern in the AST.
|
|
126
|
+
*
|
|
127
|
+
* @param ast - The AST to search
|
|
128
|
+
* @param pattern - The pattern to match
|
|
129
|
+
* @param options - Matching options
|
|
130
|
+
* @returns Array of pattern match results
|
|
131
|
+
*/
|
|
132
|
+
findPattern(ast: AST, pattern: ASTPattern, options?: PatternMatchOptions): PatternMatchResult[];
|
|
133
|
+
/**
|
|
134
|
+
* Compare two AST subtrees for similarity.
|
|
135
|
+
*
|
|
136
|
+
* @param node1 - First subtree root
|
|
137
|
+
* @param node2 - Second subtree root
|
|
138
|
+
* @param options - Comparison options
|
|
139
|
+
* @returns Comparison result with similarity score and differences
|
|
140
|
+
*/
|
|
141
|
+
compareSubtrees(node1: ASTNode, node2: ASTNode, options?: SubtreeCompareOptions): SubtreeCompareResult;
|
|
142
|
+
/**
|
|
143
|
+
* Get statistics about an AST.
|
|
144
|
+
*
|
|
145
|
+
* @param ast - The AST to analyze
|
|
146
|
+
* @returns Statistics about the AST structure
|
|
147
|
+
*/
|
|
148
|
+
getStats(ast: AST): ASTStats;
|
|
149
|
+
/**
|
|
150
|
+
* Traverse the AST depth-first, calling the visitor for each node.
|
|
151
|
+
*
|
|
152
|
+
* @param ast - The AST to traverse
|
|
153
|
+
* @param visitor - Function called for each node. Return false to stop traversal of subtree.
|
|
154
|
+
*/
|
|
155
|
+
traverse(ast: AST, visitor: ASTVisitorFn): void;
|
|
156
|
+
/**
|
|
157
|
+
* Find all nodes of a specific type in the AST.
|
|
158
|
+
*
|
|
159
|
+
* @param ast - The AST to search
|
|
160
|
+
* @param nodeType - The type of node to find
|
|
161
|
+
* @returns Array of matching nodes
|
|
162
|
+
*/
|
|
163
|
+
findNodesByType(ast: AST, nodeType: string): ASTNode[];
|
|
164
|
+
/**
|
|
165
|
+
* Find the first node of a specific type in the AST.
|
|
166
|
+
*
|
|
167
|
+
* @param ast - The AST to search
|
|
168
|
+
* @param nodeType - The type of node to find
|
|
169
|
+
* @returns The first matching node, or null if not found
|
|
170
|
+
*/
|
|
171
|
+
findFirstNodeByType(ast: AST, nodeType: string): ASTNode | null;
|
|
172
|
+
/**
|
|
173
|
+
* Find the node at a specific position in the source.
|
|
174
|
+
*
|
|
175
|
+
* @param ast - The AST to search
|
|
176
|
+
* @param position - The position to find
|
|
177
|
+
* @returns The most specific node at that position, or null
|
|
178
|
+
*/
|
|
179
|
+
findNodeAtPosition(ast: AST, position: Position): ASTNode | null;
|
|
180
|
+
/**
|
|
181
|
+
* Get all descendants of a node.
|
|
182
|
+
*
|
|
183
|
+
* @param node - The node to get descendants of
|
|
184
|
+
* @returns Array of all descendant nodes
|
|
185
|
+
*/
|
|
186
|
+
getDescendants(node: ASTNode): ASTNode[];
|
|
187
|
+
/**
|
|
188
|
+
* Get the depth of a node in the AST.
|
|
189
|
+
*
|
|
190
|
+
* @param ast - The AST containing the node
|
|
191
|
+
* @param targetNode - The node to get depth for
|
|
192
|
+
* @returns The depth (0 for root), or -1 if not found
|
|
193
|
+
*/
|
|
194
|
+
getNodeDepth(ast: AST, targetNode: ASTNode): number;
|
|
195
|
+
/**
|
|
196
|
+
* Get the parent chain from root to a specific node.
|
|
197
|
+
*
|
|
198
|
+
* @param ast - The AST to search
|
|
199
|
+
* @param targetNode - The node to find parents for
|
|
200
|
+
* @returns Array of parent nodes from root to immediate parent
|
|
201
|
+
*/
|
|
202
|
+
getParentChain(ast: AST, targetNode: ASTNode): ASTNode[];
|
|
203
|
+
/**
|
|
204
|
+
* Check if a node is a leaf node (has no children).
|
|
205
|
+
*
|
|
206
|
+
* @param node - The node to check
|
|
207
|
+
* @returns true if the node has no children
|
|
208
|
+
*/
|
|
209
|
+
isLeafNode(node: ASTNode): boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Analyze an AST and return analysis results.
|
|
212
|
+
*
|
|
213
|
+
* @param ast - The AST to analyze
|
|
214
|
+
* @param patterns - Patterns to search for
|
|
215
|
+
* @returns Analysis result with matches and statistics
|
|
216
|
+
*/
|
|
217
|
+
analyze(ast: AST, patterns: Map<string, ASTPattern>): ASTAnalysisResult;
|
|
218
|
+
/**
|
|
219
|
+
* Internal recursive traversal helper.
|
|
220
|
+
*/
|
|
221
|
+
private traverseNode;
|
|
222
|
+
/**
|
|
223
|
+
* Match a pattern against a node and return confidence score.
|
|
224
|
+
*/
|
|
225
|
+
private matchPattern;
|
|
226
|
+
/**
|
|
227
|
+
* Match text against a pattern (string or regex).
|
|
228
|
+
*/
|
|
229
|
+
private matchText;
|
|
230
|
+
/**
|
|
231
|
+
* Match child patterns against node children.
|
|
232
|
+
*/
|
|
233
|
+
private matchChildPatterns;
|
|
234
|
+
/**
|
|
235
|
+
* Compare two nodes recursively.
|
|
236
|
+
*/
|
|
237
|
+
private compareNodes;
|
|
238
|
+
/**
|
|
239
|
+
* Check if a position is within a range.
|
|
240
|
+
*/
|
|
241
|
+
private positionInRange;
|
|
242
|
+
/**
|
|
243
|
+
* Check if position a is after position b.
|
|
244
|
+
*/
|
|
245
|
+
private isAfterPosition;
|
|
246
|
+
/**
|
|
247
|
+
* Check if position a is before position b.
|
|
248
|
+
*/
|
|
249
|
+
private isBeforePosition;
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=ast-analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast-analyzer.d.ts","sourceRoot":"","sources":["../../src/analyzers/ast-analyzer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EACV,iBAAiB,EACjB,QAAQ,EAER,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEvB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;IAExB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,qDAAqD;IACrD,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;IAEvC,iEAAiE;IACjE,gBA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